
package com.thb.exception;


/**
 * 描述：
 * 
 * 自定义异常
 * 
 * @author wanglf
 * @version 1.0
 */
public class ServiceException extends RuntimeException {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	//自定义错误代码
	private String errorCode;
	//自定义错误名称
	private String errorName;
	
	private Object data;
	
	
	public ServiceException(String code,String msg) {
		super(msg);
		errorCode = code;
		errorName = msg;
		this.data = "";
	}
	
	public ServiceException(String code,String msg,Object data) {
		super(msg);
		errorCode = code;
		errorName = msg;
		this.data = data;
	}

	/**
	 * 构造函数
	 * @param msg String
	 * @param ex Throwable
	 */
	public ServiceException(String msg, Throwable ex) {
		super(msg, ex);
		// TODO Auto-generated constructor stub
	}

	/**
	 * @return the errorCode
	 */
	public String getErrorCode() {
		return errorCode;
	}

	/**
	 * @param errorCode the errorCode to set
	 */
	public void setErrorCode(String errorCode) {
		this.errorCode = errorCode;
	}

	/**
	 * @return the errorName
	 */
	public String getErrorName() {
		return errorName;
	}

	/**
	 * @param errorName the errorName to set
	 */
	public void setErrorName(String errorName) {
		this.errorName = errorName;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}
	
	

	
}
